import {defineStore} from "pinia";
export const useAppStore = defineStore('app', {
    state: () => ({
        token: '',
        hasRoutes: false,
        routes: [],
        menu: '',
        userInfo: ''
    }),
    actions: {
        setToken(token) {
            this.token = token;
        },
        setHasRoutes(hasRoutes) {
            this.hasRoutes = hasRoutes;
        },
        setRoutes(routes) {
            this.routes = routes;
        },
        setMenu(menu) {
            this.menu = menu;
        },
        setUserInfo(userInfo) {
            this.userInfo = userInfo;
        }
    },
    persist: true // 启用持久化

});
